package njClass.UI
{
	import flash.display.Shape;
	import flash.display.Sprite;
	import flash.events.Event;

	public class drawTick extends Shape
	{
		public function drawTick()
		{
			super();
		}
		
		public static function createTick(BoxWidth:Number,BoxHeight:Number):Shape{
			var temp:Shape=new Shape();
			temp.graphics.lineStyle(5,0xFF6600,0.8);
			var i:int=-4;
			temp.graphics.moveTo(BoxWidth/2-2+i,BoxHeight-Math.sqrt(Math.sqrt(Math.abs(i*i*i*i*i))));
			temp.graphics.endFill();
			temp.addEventListener(Event.ENTER_FRAME,startDraw);
			return temp;
			
			function startDraw(e:Event):void {
				if (i>=10) {
					temp.removeEventListener(Event.ENTER_FRAME,startDraw);
					return;
				}
				moveLine();
				moveLine();
				moveLine();
			}
			
			function moveLine():void {
				if (i>0) {
					temp.graphics.lineTo(BoxWidth/2-2+i,BoxHeight-Math.sqrt(Math.sqrt(Math.abs(i*i*i*i*i))));
				} else if (i<0) {
					temp.graphics.lineTo(BoxWidth/2-2+i,BoxHeight-Math.sqrt(Math.sqrt(Math.abs(i*i*i*i*i))));
				}
				i++;
			}
		}
	}
}